#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll a[55];
int n;

void insert(ll x){
	for(int i = 50;~i;i--){
		if(x >> i & 1){
			if(!a[i]) {
				a[i] = x;
				return;
			}
			else x ^= a[i];
		}
	}
}

ll getmax(){
	ll ans = 0;
	for(int i =50;~i;i--)
		if(a[i] ^ ans > ans) ans ^= a[i];
	return ans;
}

int main (){
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		ll x;scanf("%lld",&x);
		insert(x);
	}
	printf("%lld\n",getmax());
}
